<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // for循环
        var aArray = [1, 2, 3]
        for(var index = 0;index < aArray.length;index++){
            var result = aArray[index];
            alert(result);
        }
        // while循环
        var index = 0;
        while(index < aArray.length){
            var result = aArray[index];
            alert(result)
            index++;
        }
        // do while循环(无论条件是否成立，都会执行一次代码)
        var index = 0;
        do{
            var result = aArray[index];
            alert(result);
            index++;
        }while(index > aArray.length);
    </script>
</head>
<body>
    
</body>
</html>